import http from '@/common/utils/http'
export interface QueryParams {
  limit: number
  name?: string
  page: number
  status: '' | 'disable' | 'enable'
}

export interface StatusParams {
  status: 'disable' | 'enable'
  _id: string
}

export const getAllServiceGroup = (data: any) =>
  http({
    url: '/platform/action/agent/list',
    method: 'POST',
    data
  })

export const getUnServiceGroup = (data: any) =>
  http({
    url: '/platform/action/agent/noGroupsList',
    method: 'POST',
    data
  })

export const getServiceGroup = () =>
  http({
    url: '/platform/action/group/list',
    method: 'POST'
  })

export const delServiceGroup = (data: Record<string, unknown>) =>
  http({
    url: '/platform/action/group/remove',
    method: 'POST',
    data
  })

export const addServiceGroup = (data: Record<string, unknown>) =>
  http({
    url: '/platform/action/group/save',
    method: 'POST',
    data
  })

export const upDownServiceGroup = (data: Record<string, unknown>) =>
  http({
    url: '/platform/action/group/upOrDown',
    method: 'POST',
    data
  })

export const updateServiceGroup = (data: Record<string, unknown>) =>
  http({
    url: '/platform/action/group/update',
    method: 'POST',
    data
  })

export const agentCreate = (data: any) =>
  http({
    url: '/platform/action/agent/create',
    method: 'POST',
    data
  })

export const agentUpdate = (data: any) =>
  http({
    url: '/platform/action/agent/update',
    method: 'POST',
    data
  })

export const batchChangeStatus = (data: any) =>
  http({
    url: '/platform/action/agent/batchChangeStatus',
    method: 'POST',
    data
  })

export const serviceGroupBatchMove = (data: any) =>
  http({
    url: '/platform/action/group/batchUpdate',
    method: 'POST',
    data
  })

export const batchDel = (data: any) =>
  http({
    url: '/platform/action/group/batchDelete',
    method: 'POST',
    data
  })

export const getFullAgent = (params: any) =>
  http({
    url: '/platform/action/agent/getFullAgent',
    method: 'GET',
    params
  })
